#include<iostream>
using namespace std;
long long  arr[55];
int main()
{
	arr[1] = 1;
	arr[2] = 2;
	for (int i = 3; i <= 55; i++)
	{
		arr[i] = arr[i - 1] + arr[i - 2];
	}
	int n;
	while (cin >> n && n) {
		cout << arr[n] << endl;
	}
	return 0;
}